from django.conf.urls.defaults import *
from django.conf import settings

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    (r'^admin/section/change_order/((?P<section_id>\d+)/)?$', 'modulo.page.views.changeMenuOrder'),
    (r'^admin/sponsors/change_order/$', 'modulo.sponsors.views.changeSponsorOrder'),
    (r'^admin/map/change_order/$', 'modulo.map.views.changeMapOrder'),
    (r'^admin/gallery/change_order/$', 'modulo.gallery.views.changeGalleryOrder'),
    (r'^admin/map/select_map/$', 'django.views.generic.simple.direct_to_template', {'template': 'map/select_form.html'}),
    (r'^admin/filebrowser/', include('filebrowser.urls')),
    (r'^admin/', include(admin.site.urls)),
    (r'^grappelli/', include('grappelli.urls')),
    (r'^$', 'django.views.generic.simple.redirect_to', {'url': '/accueil/'}),

    # URL des medias #
    (r'^medias/(?P<path>.*)$',
     'django.views.static.serve',
     {'document_root': settings.MEDIA_ROOT}),
     (r'^jsi18n/$', 'django.views.i18n.javascript_catalog',
     {'packages': 'django.conf'}),
)
